home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / perlmodinstall.z / perlmodinstall
Encoding:
Text File  |  2002-10-03  |  17.6 KB  |  529 lines

  1.  
  2.  
  3.  
  4. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      perlmodinstall - Installing CPAN Modules
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      You can think of a module as the fundamental unit of reusable Perl code;
  13.      see the _p_e_r_l_m_o_d manpage for details.  Whenever anyone creates a chunk of
  14.      Perl code that they think will be useful to the world, they register as a
  15.      Perl developer at http://www.perl.com/CPAN/modules/04pause.html so that
  16.      they can then upload their code to the CPAN.  The CPAN is the
  17.      Comprehensive Perl Archive Network and can be accessed at
  18.      http://www.perl.com/CPAN/.
  19.  
  20.      This documentation is for people who want to download CPAN modules and
  21.      install them on their own computer.
  22.  
  23.      PPPPRRRREEEEAAAAMMMMBBBBLLLLEEEE
  24.  
  25.      You have a file ending in .tar.gz (or, less often, .zip).  You know
  26.      there's a tasty module inside.  There are four steps you must now take:
  27.  
  28.      DDDDEEEECCCCOOOOMMMMPPPPRRRREEEESSSSSSSS the file
  29.  
  30.      UUUUNNNNPPPPAAAACCCCKKKK the file into a directory
  31.  
  32.      BBBBUUUUIIIILLLLDDDD the module (sometimes unnecessary)
  33.  
  34.      IIIINNNNSSSSTTTTAAAALLLLLLLL the module.
  35.  
  36.      Here's how to perform each step for each operating system.  This is _n_o_t a
  37.      substitute for reading the README and INSTALL files that might have come
  38.      with your module!
  39.  
  40.      Also note that these instructions are tailored for installing the module
  41.      into your system's repository of Perl modules.  But you can install
  42.      modules into any directory you wish.  For instance, where I say perl
  43.      Makefile.PL, you can substitute perl Makefile.PL
  44.      PREFIX=/my/perl_directory to install the modules into /my/perl_directory.
  45.      Then you can use the modules from your Perl programs with use lib
  46.      "/my/perl_directory/lib/site_perl"; or sometimes just use
  47.      "/my/perl_directory";.
  48.  
  49.      +o   IIIIffff yyyyoooouuuu''''rrrreeee oooonnnn UUUUnnnniiiixxxx,,,,
  50.  
  51.          You can use Andreas Koenig's CPAN module (
  52.          http://www.perl.com/CPAN/modules/by-module/CPAN ) to automate the
  53.          following steps, from DECOMPRESS through INSTALL.
  54.  
  55.          A. DECOMPRESS
  56.  
  57.          Decompress the file with gzip -d yourmodule.tar.gz
  58.  
  59.          You can get gzip from ftp://prep.ai.mit.edu/pub/gnu.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  71.  
  72.  
  73.  
  74.          Or, you can combine this step with the next to save disk space:
  75.  
  76.               gzip -dc yourmodule.tar.gz | tar -xof -
  77.  
  78.          B. UNPACK
  79.  
  80.          Unpack the result with tar -xof yourmodule.tar
  81.  
  82.          C. BUILD
  83.  
  84.          Go into the newly-created directory and type:
  85.  
  86.                perl Makefile.PL
  87.                make
  88.                make test
  89.  
  90.          D. INSTALL
  91.  
  92.          While still in that directory, type:
  93.  
  94.                make install
  95.  
  96.          Make sure you have the appropriate permissions to install the module
  97.          in your Perl 5 library directory.  Often, you'll need to be root.
  98.  
  99.          That's all you need to do on Unix systems with dynamic linking.  Most
  100.          Unix systems have dynamic linking -- if yours doesn't, or if for
  101.          another reason you have a statically-linked perl, aaaannnndddd the module
  102.          requires compilation, you'll need to build a new Perl binary that
  103.          includes the module.  Again, you'll probably need to be root.
  104.  
  105.      +o   IIIIffff yyyyoooouuuu''''rrrreeee rrrruuuunnnnnnnniiiinnnngggg WWWWiiiinnnnddddoooowwwwssss 99995555 oooorrrr NNNNTTTT wwwwiiiitttthhhh tttthhhheeee AAAAccccttttiiiivvvveeeeSSSSttttaaaatttteeee ppppoooorrrrtttt ooooffff PPPPeeeerrrrllll
  106.  
  107.             A. DECOMPRESS
  108.  
  109.          You can use the shareware Winzip ( http://www.winzip.com ) to
  110.          decompress and unpack modules.
  111.  
  112.             B. UNPACK
  113.  
  114.          If you used WinZip, this was already done for you.
  115.  
  116.             C. BUILD
  117.  
  118.          Does the module require compilation (i.e. does it have files that end
  119.          in .xs, .c, .h, .y, .cc, .cxx, or .C)?  If it does, you're on your
  120.          own.  You can try compiling it yourself if you have a C compiler.  If
  121.          you're successful, consider uploading the resulting binary to the
  122.          CPAN for others to use.  If it doesn't, go to INSTALL.
  123.  
  124.             D. INSTALL
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  137.  
  138.  
  139.  
  140.          Copy the module into your Perl's _l_i_b directory.  That'll be one of
  141.          the directories you see when you type
  142.  
  143.             perl -e 'print "@INC"'
  144.  
  145.  
  146.      +o   IIIIffff yyyyoooouuuu''''rrrreeee rrrruuuunnnnnnnniiiinnnngggg WWWWiiiinnnnddddoooowwwwssss 99995555 oooorrrr NNNNTTTT wwwwiiiitttthhhh tttthhhheeee ccccoooorrrreeee WWWWiiiinnnnddddoooowwwwssss ddddiiiissssttttrrrriiiibbbbuuuuttttiiiioooonnnn
  147.          ooooffff PPPPeeeerrrrllll,,,,
  148.  
  149.             A. DECOMPRESS
  150.  
  151.          When you download the module, make sure it ends in either .tar.gz or
  152.          .zip.  Windows browsers sometimes download .tar.gz files as _tar.tar,
  153.          because early versions of Windows prohibited more than one dot in a
  154.          filename.
  155.  
  156.          You can use the shareware WinZip ( http://www.winzip.com ) to
  157.          decompress and unpack modules.
  158.  
  159.          Or, you can use InfoZip's unzip utility (
  160.          http://www.cdrom.com/pub/infozip/Info-Zip.html ) to uncompress .zip
  161.          files; type unzip yourmodule.zip in your shell.
  162.  
  163.          Or, if you have a working tar and gzip, you can type
  164.  
  165.             gzip -cd yourmodule.tar.gz | tar xvf -
  166.  
  167.          in the shell to decompress yourmodule.tar.gz.  This will UNPACK your
  168.          module as well.
  169.  
  170.             B. UNPACK
  171.  
  172.          All of the methods in DECOMPRESS will have done this for you.
  173.  
  174.             C. BUILD
  175.  
  176.          Go into the newly-created directory and type:
  177.  
  178.                perl Makefile.PL
  179.                dmake
  180.                dmake test
  181.  
  182.          Depending on your perl configuration, dmake might not be available.
  183.          You might have to substitute whatever perl -V:make says. (Usually,
  184.          that will be nmake or make.)
  185.  
  186.             D. INSTALL
  187.  
  188.          While still in that directory, type:
  189.  
  190.                dmake install
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  203.  
  204.  
  205.  
  206.      +o   IIIIffff yyyyoooouuuu''''rrrreeee uuuussssiiiinnnngggg aaaa MMMMaaaacccciiiinnnnttttoooosssshhhh,,,,
  207.  
  208.          A. DECOMPRESS
  209.  
  210.          You can either use StuffIt Expander ( http://www.aladdinsys.com/ ) in
  211.          combination with _D_r_o_p_S_t_u_f_f _w_i_t_h _E_x_p_a_n_d_e_r _E_n_h_a_n_c_e_r (shareware), or the
  212.          freeware MacGzip (
  213.          http://persephone.cps.unizar.es/general/gente/spd/gzip/gzip.html ).
  214.  
  215.          B. UNPACK
  216.  
  217.          If you're using DropStuff or Stuffit, you can just extract the tar
  218.          archive.  Otherwise, you can use the freeware _s_u_n_t_a_r (
  219.          http://www.cirfid.unibo.it/~speranza ).
  220.  
  221.          C. BUILD
  222.  
  223.          Does the module require compilation?
  224.  
  225.          1. If it does,
  226.  
  227.          Overview: You need MPW and a combination of new and old CodeWarrior
  228.          compilers for MPW and libraries.  Makefiles created for building
  229.          under MPW use the Metrowerks compilers.  It's most likely possible to
  230.          build without other compilers, but it has not been done successfully,
  231.          to our knowledge.  Read the documentation in MacPerl: Power and Ease
  232.          ( http://www.ptf.com/macperl/ ) on porting/building extensions, or
  233.          find an existing precompiled binary, or hire someone to build it for
  234.          you.
  235.  
  236.          Or, ask someone on the mac-perl mailing list (mac-
  237.          perl@iis.ee.ethz.ch) to build it for you.  To subscribe to the mac-
  238.          perl mailing list, send mail to mac-perl-request@iis.ee.ethz.ch.
  239.  
  240.          2. If the module doesn't require compilation, go to INSTALL.
  241.  
  242.          D. INSTALL
  243.  
  244.          Make sure the newlines for the modules are in Mac format, not Unix
  245.          format.  Move the files manually into the correct folders.
  246.  
  247.          Move the files to their final destination: This will most likely be
  248.          in $ENV{MACPERL}site_lib: (i.e., HD:MacPerl folder:site_lib:).  You
  249.          can add new paths to the default @INC in the Preferences menu item in
  250.          the MacPerl application ($ENV{MACPERL}site_lib: is added
  251.          automagically).  Create whatever directory structures are required
  252.          (i.e., for Some::Module, create $ENV{MACPERL}site_lib:Some: and put
  253.          Module.pm in that directory).
  254.  
  255.          Run the following script (or something like it):
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  269.  
  270.  
  271.  
  272.               #!perl -w
  273.               use AutoSplit;
  274.               my $dir = "${MACPERL}site_perl";
  275.               autosplit("$dir:Some:Module.pm", "$dir:auto", 0, 1, 1);
  276.  
  277.          Eventually there should be a way to automate the installation
  278.          process; some solutions exist, but none are ready for the general
  279.          public yet.
  280.  
  281.      +o   IIIIffff yyyyoooouuuu''''rrrreeee oooonnnn tttthhhheeee DDDDJJJJGGGGPPPPPPPP ppppoooorrrrtttt ooooffff DDDDOOOOSSSS,,,,
  282.  
  283.             A. DECOMPRESS
  284.  
  285.          djtarx ( ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/ ) will both
  286.          uncompress and unpack.
  287.  
  288.             B. UNPACK
  289.  
  290.          See above.
  291.  
  292.             C. BUILD
  293.  
  294.          Go into the newly-created directory and type:
  295.  
  296.                perl Makefile.PL
  297.                make
  298.                make test
  299.  
  300.          You will need the packages mentioned in Readme.dos in the Perl
  301.          distribution.
  302.  
  303.             D. INSTALL
  304.  
  305.          While still in that directory, type:
  306.  
  307.               make install
  308.  
  309.          You will need the packages mentioned in Readme.dos in the Perl distribution.
  310.  
  311.  
  312.      +o   IIIIffff yyyyoooouuuu''''rrrreeee oooonnnn OOOOSSSS////2222,,,,
  313.  
  314.          Get the EMX development suite and gzip/tar, from either Hobbes (
  315.          http://hobbes.nmsu.edu ) or Leo ( http://www.leo.org ), and then
  316.          follow the instructions for Unix.
  317.  
  318.      +o   IIIIffff yyyyoooouuuu''''rrrreeee oooonnnn VVVVMMMMSSSS,,,,
  319.  
  320.          When downloading from CPAN, save your file with a .tgz extension
  321.          instead of .tar.gz.  All other periods in the filename should be
  322.          replaced with underscores.  For example, Your-Module-1.33.tar.gz
  323.          should be downloaded as Your-Module-1_33.tgz.
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  335.  
  336.  
  337.  
  338.          A. DECOMPRESS
  339.  
  340.          Type
  341.  
  342.              gzip -d Your-Module.tgz
  343.  
  344.          or, for zipped modules, type
  345.  
  346.              unzip Your-Module.zip
  347.  
  348.          Executables for gzip, zip, and VMStar ( Alphas:
  349.          http://www.openvms.digital.com/cd/000TOOLS/ALPHA/ and Vaxen:
  350.          http://www.openvms.digital.com/cd/000TOOLS/VAX/ ).
  351.  
  352.          gzip and tar are also available at ftp://ftp.digital.com/pub/VMS.
  353.  
  354.          Note that GNU's gzip/gunzip is not the same as Info-ZIP's zip/unzip
  355.          package.  The former is a simple compression tool; the latter permits
  356.          creation of multi-file archives.
  357.  
  358.          B. UNPACK
  359.  
  360.          If you're using VMStar:
  361.  
  362.               VMStar xf Your-Module.tar
  363.  
  364.          Or, if you're fond of VMS command syntax:
  365.  
  366.               tar/extract/verbose Your_Module.tar
  367.  
  368.          C. BUILD
  369.  
  370.          Make sure you have MMS (from Digital) or the freeware MMK ( available
  371.          from MadGoat at  http://www.madgoat.com ).  Then type this to create
  372.          the DESCRIP.MMS for the module:
  373.  
  374.              perl Makefile.PL
  375.  
  376.          Now you're ready to build:
  377.  
  378.              mms
  379.              mms test
  380.  
  381.          Substitute mmk for mms above if you're using MMK.
  382.  
  383.          D. INSTALL
  384.  
  385.          Type
  386.  
  387.              mms install
  388.  
  389.          Substitute mmk for mms above if you're using MMK.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  401.  
  402.  
  403.  
  404.      +o   IIIIffff yyyyoooouuuu''''rrrreeee oooonnnn MMMMVVVVSSSS,
  405.  
  406.          Introduce the .tar.gz file into an HFS as binary; don't translate
  407.          from ASCII to EBCDIC.
  408.  
  409.          A. DECOMPRESS
  410.  
  411.                Decompress the file with C<gzip -d yourmodule.tar.gz>
  412.  
  413.                You can get gzip from
  414.                http://www.s390.ibm.com/products/oe/bpxqp1.html.
  415.  
  416.          B. UNPACK
  417.  
  418.          Unpack the result with
  419.  
  420.               pax -o to=IBM-1047,from=ISO8859-1 -r < yourmodule.tar
  421.  
  422.          The BUILD and INSTALL steps are identical to those for Unix.  Some
  423.          modules generate Makefiles that work better with GNU make, which is
  424.          available from http://www.mks.com/s390/gnu/index.htm.
  425.  
  426. HHHHEEEEYYYY
  427.      If you have any suggested changes for this page, let me know.  Please
  428.      don't send me mail asking for help on how to install your modules.  There
  429.      are too many modules, and too few Orwants, for me to be able to answer or
  430.      even acknowledge all your questions.  Contact the module author instead,
  431.      or post to comp.lang.perl.modules, or ask someone familiar with Perl on
  432.      your operating system.
  433.  
  434. AAAAUUUUTTTTHHHHOOOORRRR
  435.      Jon Orwant
  436.  
  437.      orwant@tpj.com
  438.  
  439.      The Perl Journal, http://tpj.com
  440.  
  441.      with invaluable help from Brandon Allbery, Charles Bailey, Graham Barr,
  442.      Dominic Dunlop, Jarkko Hietaniemi, Ben Holzman, Tom Horsley, Nick Ing-
  443.      Simmons, Tuomas J. Lukka, Laszlo Molnar, Chris Nandor, Alan Olsen, Peter
  444.      Prymmer, Gurusamy Sarathy, Christoph Spalinger, Dan Sugalski, Larry
  445.      Virden, and Ilya Zakharevich.
  446.  
  447.      July 22, 1998
  448.  
  449. CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  450.      Copyright (C) 1998 Jon Orwant.  All Rights Reserved.
  451.  
  452.      Permission is granted to make and distribute verbatim copies of this
  453.      documentation provided the copyright notice and this permission notice
  454.      are preserved on all copies.
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))                                            PPPPEEEERRRRLLLLMMMMOOOODDDDIIIINNNNSSSSTTTTAAAALLLLLLLL((((1111))))
  467.  
  468.  
  469.  
  470.      Permission is granted to copy and distribute modified versions of this
  471.      documentation under the conditions for verbatim copying, provided also
  472.      that they are marked clearly as modified versions, that the authors'
  473.      names and title are unchanged (though subtitles and additional authors'
  474.      names may be added), and that the entire resulting derived work is
  475.      distributed under the terms of a permission notice identical to this one.
  476.  
  477.      Permission is granted to copy and distribute translations of this
  478.      documentation into another language, under the above conditions for
  479.      modified versions.
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.